package com.yuan.statemachine.business.distribute;

import com.yuan.statemachine.business.BusinessEventEnum;
import com.yuan.statemachine.business.BusinessFunctionEnum;
import com.yuan.statemachine.business.BusinessStateMachine;
import com.yuan.statemachine.business.MessageBody;
import com.yuan.statemachine.core.StateMachine;
import org.springframework.stereotype.Service;

/**
 * @author wjwei
 * 待揽收
 */
@Service
public class CreatedService extends BusinessStateMachine<BusinessFunctionEnum,DistributeStatusEnum,BusinessEventEnum> {

    @Override
    public void registrar(StateMachine<BusinessFunctionEnum,DistributeStatusEnum,BusinessEventEnum> stateMachine) {
        stateMachine.register(this, DistributeStatusEnum.CREATED, BusinessFunctionEnum.DISTRIBUTE);
    }

    @Override
    public MessageBody intercept(Object data) {
        return MessageBody.success(data);
    }

    @Override
    public MessageBody collect(Object data) {
        return MessageBody.success(data);
    }
}
